3.7.74 \(\int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^4} \, dx\) [674]

Optimal. Leaf size=57 \[ -\frac {a (i A+B)}{4 c^4 f (i+\tan (e+f x))^4}-\frac {i a B}{3 c^4 f (i+\tan (e+f x))^3} \]

[Out]

-1/4*a*(I*A+B)/c^4/f/(I+tan(f*x+e))^4-1/3*I*a*B/c^4/f/(I+tan(f*x+e))^3

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3669, 45} \begin {gather*} -\frac {a (B+i A)}{4 c^4 f (\tan (e+f x)+i)^4}-\frac {i a B}{3 c^4 f (\tan (e+f x)+i)^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^4,x]

[Out]

-1/4*(a*(I*A + B))/(c^4*f*(I + Tan[e + f*x])^4) - ((I/3)*a*B)/(c^4*f*(I + Tan[e + f*x])^3)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \frac {(a+i a \tan (e+f x)) (A+B \tan (e+f x))}{(c-i c \tan (e+f x))^4} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(c-i c x)^5} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {i A+B}{c^5 (i+x)^5}+\frac {i B}{c^5 (i+x)^4}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {a (i A+B)}{4 c^4 f (i+\tan (e+f x))^4}-\frac {i a B}{3 c^4 f (i+\tan (e+f x))^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.81, size = 97, normalized size = 1.70 \begin {gather*} \frac {a (2 (-15 i A+B) \cos (e+f x)+3 (-5 i A+3 B) \cos (3 (e+f x))-(3 A+5 i B) (2 \sin (e+f x)+3 \sin (3 (e+f x)))) (\cos (5 (e+f x))+i \sin (5 (e+f x)))}{192 c^4 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x]))/(c - I*c*Tan[e + f*x])^4,x]

[Out]

(a*(2*((-15*I)*A + B)*Cos[e + f*x] + 3*((-5*I)*A + 3*B)*Cos[3*(e + f*x)] - (3*A + (5*I)*B)*(2*Sin[e + f*x] + 3
*Sin[3*(e + f*x)]))*(Cos[5*(e + f*x)] + I*Sin[5*(e + f*x)]))/(192*c^4*f)

________________________________________________________________________________________

Maple [A]
time = 0.23, size = 44, normalized size = 0.77

method result size
derivativedivides \(\frac {a \left (-\frac {i A +B}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {i B}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}\right )}{f \,c^{4}}\) \(44\)
default \(\frac {a \left (-\frac {i A +B}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {i B}{3 \left (i+\tan \left (f x +e \right )\right )^{3}}\right )}{f \,c^{4}}\) \(44\)
risch \(-\frac {a \,{\mathrm e}^{8 i \left (f x +e \right )} B}{64 c^{4} f}-\frac {i a \,{\mathrm e}^{8 i \left (f x +e \right )} A}{64 c^{4} f}-\frac {{\mathrm e}^{6 i \left (f x +e \right )} B a}{48 c^{4} f}-\frac {i {\mathrm e}^{6 i \left (f x +e \right )} a A}{16 c^{4} f}+\frac {{\mathrm e}^{4 i \left (f x +e \right )} B a}{32 c^{4} f}-\frac {3 i {\mathrm e}^{4 i \left (f x +e \right )} a A}{32 c^{4} f}+\frac {a \,{\mathrm e}^{2 i \left (f x +e \right )} B}{16 c^{4} f}-\frac {i a \,{\mathrm e}^{2 i \left (f x +e \right )} A}{16 c^{4} f}\) \(158\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x,method=_RETURNVERBOSE)

[Out]

1/f*a/c^4*(-1/4*(I*A+B)/(I+tan(f*x+e))^4-1/3*I*B/(I+tan(f*x+e))^3)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 13.34, size = 85, normalized size = 1.49 \begin {gather*} -\frac {3 \, {\left (i \, A + B\right )} a e^{\left (8 i \, f x + 8 i \, e\right )} + 4 \, {\left (3 i \, A + B\right )} a e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, {\left (3 i \, A - B\right )} a e^{\left (4 i \, f x + 4 i \, e\right )} + 12 \, {\left (i \, A - B\right )} a e^{\left (2 i \, f x + 2 i \, e\right )}}{192 \, c^{4} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="fricas")

[Out]

-1/192*(3*(I*A + B)*a*e^(8*I*f*x + 8*I*e) + 4*(3*I*A + B)*a*e^(6*I*f*x + 6*I*e) + 6*(3*I*A - B)*a*e^(4*I*f*x +
 4*I*e) + 12*(I*A - B)*a*e^(2*I*f*x + 2*I*e))/(c^4*f)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 304 vs. \(2 (46) = 92\).
time = 0.32, size = 304, normalized size = 5.33 \begin {gather*} \begin {cases} \frac {\left (- 98304 i A a c^{12} f^{3} e^{2 i e} + 98304 B a c^{12} f^{3} e^{2 i e}\right ) e^{2 i f x} + \left (- 147456 i A a c^{12} f^{3} e^{4 i e} + 49152 B a c^{12} f^{3} e^{4 i e}\right ) e^{4 i f x} + \left (- 98304 i A a c^{12} f^{3} e^{6 i e} - 32768 B a c^{12} f^{3} e^{6 i e}\right ) e^{6 i f x} + \left (- 24576 i A a c^{12} f^{3} e^{8 i e} - 24576 B a c^{12} f^{3} e^{8 i e}\right ) e^{8 i f x}}{1572864 c^{16} f^{4}} & \text {for}\: c^{16} f^{4} \neq 0 \\\frac {x \left (A a e^{8 i e} + 3 A a e^{6 i e} + 3 A a e^{4 i e} + A a e^{2 i e} - i B a e^{8 i e} - i B a e^{6 i e} + i B a e^{4 i e} + i B a e^{2 i e}\right )}{8 c^{4}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))**4,x)

[Out]

Piecewise((((-98304*I*A*a*c**12*f**3*exp(2*I*e) + 98304*B*a*c**12*f**3*exp(2*I*e))*exp(2*I*f*x) + (-147456*I*A
*a*c**12*f**3*exp(4*I*e) + 49152*B*a*c**12*f**3*exp(4*I*e))*exp(4*I*f*x) + (-98304*I*A*a*c**12*f**3*exp(6*I*e)
 - 32768*B*a*c**12*f**3*exp(6*I*e))*exp(6*I*f*x) + (-24576*I*A*a*c**12*f**3*exp(8*I*e) - 24576*B*a*c**12*f**3*
exp(8*I*e))*exp(8*I*f*x))/(1572864*c**16*f**4), Ne(c**16*f**4, 0)), (x*(A*a*exp(8*I*e) + 3*A*a*exp(6*I*e) + 3*
A*a*exp(4*I*e) + A*a*exp(2*I*e) - I*B*a*exp(8*I*e) - I*B*a*exp(6*I*e) + I*B*a*exp(4*I*e) + I*B*a*exp(2*I*e))/(
8*c**4), True))

________________________________________________________________________________________

Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 213 vs. \(2 (47) = 94\).
time = 0.95, size = 213, normalized size = 3.74 \begin {gather*} -\frac {2 \, {\left (3 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{7} + 9 i \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 3 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 21 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 4 i \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 24 i \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 8 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 21 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 4 i \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 9 i \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 3 \, B a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 3 \, A a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{3 \, c^{4} f {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{8}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))/(c-I*c*tan(f*x+e))^4,x, algorithm="giac")

[Out]

-2/3*(3*A*a*tan(1/2*f*x + 1/2*e)^7 + 9*I*A*a*tan(1/2*f*x + 1/2*e)^6 - 3*B*a*tan(1/2*f*x + 1/2*e)^6 - 21*A*a*ta
n(1/2*f*x + 1/2*e)^5 - 4*I*B*a*tan(1/2*f*x + 1/2*e)^5 - 24*I*A*a*tan(1/2*f*x + 1/2*e)^4 + 8*B*a*tan(1/2*f*x +
1/2*e)^4 + 21*A*a*tan(1/2*f*x + 1/2*e)^3 + 4*I*B*a*tan(1/2*f*x + 1/2*e)^3 + 9*I*A*a*tan(1/2*f*x + 1/2*e)^2 - 3
*B*a*tan(1/2*f*x + 1/2*e)^2 - 3*A*a*tan(1/2*f*x + 1/2*e))/(c^4*f*(tan(1/2*f*x + 1/2*e) + I)^8)

________________________________________________________________________________________

Mupad [B]
time = 8.67, size = 73, normalized size = 1.28 \begin {gather*} -\frac {\frac {a\,\left (-B+A\,3{}\mathrm {i}\right )}{12}+\frac {B\,a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}{3}}{c^4\,f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4+{\mathrm {tan}\left (e+f\,x\right )}^3\,4{}\mathrm {i}-6\,{\mathrm {tan}\left (e+f\,x\right )}^2-\mathrm {tan}\left (e+f\,x\right )\,4{}\mathrm {i}+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i))/(c - c*tan(e + f*x)*1i)^4,x)

[Out]

-((a*(A*3i - B))/12 + (B*a*tan(e + f*x)*1i)/3)/(c^4*f*(tan(e + f*x)^3*4i - 6*tan(e + f*x)^2 - tan(e + f*x)*4i
+ tan(e + f*x)^4 + 1))

________________________________________________________________________________________